Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(parser): lex JSXText with memchr #2558

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

overlookmotel
Copy link
Contributor

@overlookmotel overlookmotel commented Mar 1, 2024

Lexing JSXText only requires searching for 2 possible characters (< and {), so can use memchr.

Copy link

codspeed-hq bot commented Mar 1, 2024

CodSpeed Performance Report

Merging #2558 will improve performances by 8.03%

Comparing 03-01-perf_parser_lex_JSXText_with_memchr (e109e78) with main (f00834d)

Summary

⚡ 2 improvements
✅ 25 untouched benchmarks

Benchmarks breakdown

Benchmark main 03-01-perf_parser_lex_JSXText_with_memchr Change
parser[RadixUIAdoptionSection.jsx] 346.2 µs 320.4 µs +8.03%
transformer[RadixUIAdoptionSection.jsx] 760.1 µs 734.3 µs +3.51%

@overlookmotel overlookmotel force-pushed the 03-01-perf_parser_faster_lexing_JSX_identifiers branch from 0852391 to 5857db3 Compare March 1, 2024 01:05
@overlookmotel overlookmotel force-pushed the 03-01-perf_parser_lex_JSXText_with_memchr branch 2 times, most recently from 1082bd3 to ca4e27a Compare March 1, 2024 01:14
@overlookmotel overlookmotel changed the base branch from 03-01-perf_parser_faster_lexing_JSX_identifiers to 02-29-refactor_parser_byte_search_macro_evaluate_to_matched_byte March 1, 2024 01:14
@overlookmotel overlookmotel marked this pull request as ready for review March 1, 2024 01:20
@Boshen Boshen force-pushed the 02-29-refactor_parser_byte_search_macro_evaluate_to_matched_byte branch from 51e0e5c to 47e1a42 Compare March 1, 2024 13:23
Base automatically changed from 02-29-refactor_parser_byte_search_macro_evaluate_to_matched_byte to main March 1, 2024 13:28
@Boshen
Copy link
Member

Boshen commented Mar 1, 2024

@overlookmotel can you restack this, this PR is going off the rails 😅

@overlookmotel overlookmotel force-pushed the 03-01-perf_parser_lex_JSXText_with_memchr branch from ca4e27a to e109e78 Compare March 1, 2024 13:55
@overlookmotel
Copy link
Contributor Author

"We prefer smaller PRs". Well you asked for it!

Restacked now.

FYI The various other draft PRs branching off this are things I'd hoped would be simple to merge as a single stack, but they're not having the positive effects I'd hoped for on benchmarks, so want to fiddle with them a bit more.

@Boshen Boshen merged commit 78f8c2c into main Mar 1, 2024
25 of 42 checks passed
@Boshen Boshen deleted the 03-01-perf_parser_lex_JSXText_with_memchr branch March 1, 2024 14:26
a-rustacean pushed a commit to a-rustacean/oxc that referenced this pull request Mar 4, 2024
Lexing JSXText only requires searching for 2 possible characters (`<`
and `{`), so can use `memchr`.
a-rustacean added a commit to a-rustacean/oxc that referenced this pull request Mar 4, 2024
a-rustacean added a commit to a-rustacean/oxc that referenced this pull request Mar 4, 2024
IWANABETHATGUY pushed a commit to IWANABETHATGUY/oxc that referenced this pull request May 29, 2024
Lexing JSXText only requires searching for 2 possible characters (`<`
and `{`), so can use `memchr`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area - Parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants